package com.service;

import com.dao.QmDao;
import com.entity.Qm;
import com.util.LocalInformation;
import org.apache.commons.lang3.StringUtils;

import java.util.*;

import static com.util.StrUtil.*;

/**
 * Created by wlc on 2018/3/28.
 */
public class QmOperator {
    /**
     * 处理高斯文件上传
     * @param author
     * @param log_file_path
     * @param log_file_name
     * @param dat_file_path
     * @return
     * @throws Exception
     */
    public static String processGaussFile(String author,
                                        String log_file_path,
                                        String log_file_name,
                                        String dat_file_path) throws Exception {
        HashMap<String, String> form_data = QmDao.readAndProcess_logFile(log_file_path, log_file_name);

        if (!log_file_path.contains(dat_file_path)) {
            form_data.replace("Accessible_surface", QmDao.readAndProcess_datFile(dat_file_path, log_file_name));
        }
        if (form_data.get("ErrorTermination").equals("False")){
            //                part1
//            String[] part1 = new String[7];
            ////////////////////////////
            String[] part1 = new String[8];
            part1[0] = LocalInformation.getTimeID();
            part1[1] = author;
            part1[6] = "QM_CalculationObject_SolventSolute";
            //
            part1[7] = log_file_name;
            for (int i = 0; i < part1.length; i++) {
                if (isEmpty(part1[i])) {
                    part1[i] = "null";
                }
            }
            //                part2
            String[] part2 = new String[68];
            ArrayList<String> Solute_elementAndnum = new ArrayList<>(Arrays.asList(form_data.get("Stoichiometry").split(",")));
            for (int j = 0; j < Solute_elementAndnum.size(); ) {
                if (j != Solute_elementAndnum.size() - 1 && isNumeric(Solute_elementAndnum.get(j + 1))) {
                    j = j + 2;
                } else {
                    Solute_elementAndnum.add(j + 1, "1");
                    j = j + 2;
                }
            }
            int Solute_a_num = 0;
            for (int j = 0; j < Solute_elementAndnum.size(); j = j + 2) {
                part2[j] = Solute_elementAndnum.get(j);
                part2[j + 1] = Solute_elementAndnum.get(j + 1);
                Solute_a_num = Solute_a_num + Integer.parseInt(Solute_elementAndnum.get(j + 1));
            }
            part2[14] = form_data.get("Solute_Charge");
            part2[15] = form_data.get("Solute_Multiplicity");
            part2[18] = form_data.get("Solute_CAS");
            part2[38] = "1";
            part2[39] = String.valueOf(Solute_a_num);
            for (int i = 0; i < part2.length; i++) {
                if (isEmpty(part2[i])) {
                    part2[i] = "null";
                }
            }
            //                part3
            String[] part3 = new String[37];
            part3[24] = form_data.get("Program");
            part3[25] = form_data.get("Sub_system_program");
            part3[26] = form_data.get("node");
            part3[31] = form_data.get("Calculate_base_set");
            for (int i = 0; i < part3.length; i++) {
                if (isEmpty(part3[i])) {
                    part3[i] = "null";
                }
            }
            //                part4
            String[] part4 = new String[57];

            part4[0] = form_data.get("Gaussian_Keywords");
            part4[3] = form_data.get("energy");
            part4[7] = form_data.get("Basis_function");
            part4[8] = form_data.get("atomic");
            part4[9] = form_data.get("x_coor");
            part4[10] = form_data.get("y_coor");
            part4[11] = form_data.get("z_coor");
            part4[12] = form_data.get("Mulliken");
            part4[21] = form_data.get("HOMO-1");
            part4[22] = form_data.get("HOMO");
            part4[23] = form_data.get("LUMO");
            part4[24] = form_data.get("LUMO+1");
            part4[25] = form_data.get("HOMO_LUMO");
            part4[26] = form_data.get("X") + ";" + form_data.get("Y") + ";" + form_data.get("Z") + ";" + form_data.get("Tot");
            part4[27] = form_data.get("XX") + ";" + form_data.get("YY") + ";" + form_data.get("ZZ") + ";" + form_data.get("XY") + ";" + form_data.get("XZ") + ";" + form_data.get("YZ");
            part4[28] = form_data.get("XXX") + ";" + form_data.get("YYY") + ";" + form_data.get("ZZZ") + ";" + form_data.get("XYY") + ";" + form_data.get("XXY") + ";" + form_data.get("XXZ") + ";" + form_data.get("XZZ") + ";" + form_data.get("YZZ") + ";" + form_data.get("YYZ") + ";" + form_data.get("XYZ");
            part4[35] = form_data.get("Frequencies");
            part4[38] = form_data.get("entropy");
            part4[43] = form_data.get("Zero_calibration");
            part4[44] = form_data.get("Accessible_surface");
            part4[47] = form_data.get("Free_Energy");
            for (int i = 0; i < part4.length; i++) {
                if (isEmpty(part4[i])) {
                    part4[i] = "null";
                }
            }

            Qm qm = new Qm();
            qm.setQM_USER_AND_PBC(StringUtils.join(part1, "wlcniubi"));
            qm.setQM_Calculation_object(StringUtils.join(part2, "wlcniubi"));
            qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(part3, "wlcniubi"));
            qm.setQM_Ground_state_excited_state(StringUtils.join(part4, "wlcniubi"));
            QmDao.data_save(qm, "溶质溶剂");

            return "success";
        }else {
            return "false";
        }
    }

    /**
     * 处理GEBF文件上传
     * @param author
     * @param keys_file_path
     * @param cha_file_path
     * @param txt_file_path
     * @param fra_file_path
     * @param log_file_path
     * @throws Exception
     */
    public static void processGebfFile(String author,
                                       String keys_file_path,
                                       String cha_file_path,
                                       String txt_file_path,
                                       String fra_file_path,
                                       String log_file_path) throws Exception {
        HashMap<String, String> form_data = QmDao.readAndProcess_GEBFFile(keys_file_path, cha_file_path, txt_file_path, log_file_path);

        //                part1
        // 暂改为8,存储log格式文件名
        String[] part1 = new String[8];
        part1[0] = LocalInformation.getTimeID();
        part1[1] = author;
        part1[6] = "QM_CalculationObject_SolventSolute";
        for (int i = 0; i < part1.length; i++) {
            if (isEmpty(part1[i])) {
                part1[i] = "null";
            }
        }
        //                part2
        String[] part2 = new String[68];
        for (int i = 0; i < part2.length; i++) {
            if (isEmpty(part2[i])) {
                part2[i] = "null";
            }
        }
        //                part3
        String[] part3 = new String[37];
        part3[2] = "GEBF";
        part3[3] = form_data.get("Double_center");
        part3[4] = form_data.get("Two_body");
        part3[5] = form_data.get("Three_body");
        part3[6] = form_data.get("Cut_off_the_distance");
        part3[7] = form_data.get("Charge");
        String BSSE;
        if (form_data.get("BSSE_correction").equals("null")) {
            BSSE = "(无)";
        } else if (form_data.get("BSSE_correction").contains("true")) {
            BSSE = "YES";
        } else {
            BSSE = "NO";
        }
        part3[8] = BSSE;
        part3[9] = form_data.get("Block_method2");
        part3[11] = form_data.get("The_maximum_number_of_basis_functions");
        part3[12] = form_data.get("Subsystem_calculates_memory");
        part3[13] = form_data.get("The_total_number_of_sub_system");
        part3[14] = form_data.get("Subsystem_parallel_number");
        part3[15] = form_data.get("The_maximum_number_of_sub_system_blocks");
        part3[16] = fra_file_path;
        part3[24] = form_data.get("Program");
        part3[25] = form_data.get("Sub_system_program");
        part3[31] = form_data.get("Calculate_base_set");
        for (int i = 0; i < part3.length; i++) {
            if (isEmpty(part3[i])) {
                part3[i] = "null";
            }
        }
        //                part4
        String[] part4 = new String[57];
        part4[8] = form_data.get("atomic");
        part4[12] = form_data.get("mulliken");
        part4[13] = form_data.get("npa");
        part4[14] = form_data.get("esp");
        part4[37] = form_data.get("MP2_energy");
        part4[40] = form_data.get("CCSD_energy");
        part4[42] = form_data.get("HF_energy");
        for (int i = 0; i < part4.length; i++) {
            if (isEmpty(part4[i])) {
                part4[i] = "null";
            }
        }

        Qm qm = new Qm();
        qm.setQM_USER_AND_PBC(StringUtils.join(part1, "wlcniubi"));
        qm.setQM_Calculation_object(StringUtils.join(part2, "wlcniubi"));
        qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(part3, "wlcniubi"));
        qm.setQM_Ground_state_excited_state(StringUtils.join(part4, "wlcniubi"));
        QmDao.data_save(qm, "溶质溶剂");
    }

    /**
     * 处理dmol3文件上传
     * @param author
     * @param cif_file_path
     * @param dosOutmol_file_path
     * @param bandStrOutmol_file_path
     * @param outmol_file_path
     * @throws Exception
     */
    public static void processDmol3File(String author,
                                        String cif_file_path,
                                        String outmol_file_path,
                                        String dosOutmol_file_path,
                                        String bandStrOutmol_file_path,
                                        String calculateObject) throws Exception {
        HashMap<String, String> form_data = QmDao.readAndProcess_dmol3File(cif_file_path, outmol_file_path, dosOutmol_file_path, bandStrOutmol_file_path);

        //                part1
        String[] part1 = new String[8];
        part1[0] = LocalInformation.getTimeID();
        part1[1] = author;
        switch (calculateObject) {
            case "晶体":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = form_data.get("Space_group");
                part1[6] = "QM_CalculationObject_Crystal";
                break;
            case "Cluster":
                part1[2] = "NO";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = form_data.get("Space_group");
                part1[6] = "QM_CalculationObject_Crystal";
                break;
            case "Slab模型":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = form_data.get("Space_group");
                part1[6] = "QM_CalculationObject_Slab";
                break;
        }
        for (int i = 0; i < part1.length; i++) {
            if (isEmpty(part1[i])) {
                part1[i] = "null";
            }
        }
        //                part2
        String[] part2 = new String[1];
        switch (calculateObject) {
            case "晶体":
                part2 = new String[27];
                part2[0] = form_data.get("Crystal_CrystalSystem");
                part2[2] = form_data.get("Crystal_Grid");
                HashMap<String, Integer> eleAndNum = wordCount(form_data.get("priAtomic").split(";"));
                Iterator iter = eleAndNum.entrySet().iterator();
                int i = 0;
                while (iter.hasNext()) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    part2[3 + i] = (String) entry.getKey();
                    part2[4 + i] = String.valueOf(entry.getValue());
                    i = i + 2;
                }
                part2[21] = form_data.get("Crystal_Charge");
                part2[22] = form_data.get("Crystal_Multiplicity");
                break;
            case "Cluster":
                part2 = new String[27];
                part2[0] = form_data.get("Crystal_CrystalSystem");
                part2[2] = form_data.get("Crystal_Grid");
                eleAndNum = wordCount(form_data.get("priAtomic").split(";"));
                iter = eleAndNum.entrySet().iterator();
                i = 0;
                while (iter.hasNext()) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    part2[3 + i] = (String) entry.getKey();
                    part2[4 + i] = String.valueOf(entry.getValue());
                    i = i + 2;
                }
                part2[21] = form_data.get("Crystal_Charge");
                part2[22] = form_data.get("Crystal_Multiplicity");
                break;
            case "Slab模型":
                part2 = new String[32];
                part2[0] = form_data.get("Crystal_CrystalSystem");
                part2[2] = form_data.get("Crystal_Grid");
                eleAndNum = wordCount(form_data.get("priAtomic").split(";"));
                iter = eleAndNum.entrySet().iterator();
                i = 0;
                while (iter.hasNext()) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    part2[6 + i] = (String) entry.getKey();
                    part2[7 + i] = String.valueOf(entry.getValue());
                    i = i + 2;
                }
                part2[26] = form_data.get("Crystal_Charge");
                part2[27] = form_data.get("Crystal_Multiplicity");
                break;
        }
        for (int i = 0; i < part2.length; i++) {
            if (isEmpty(part2[i])) {
                part2[i] = "null";
            }
        }
        //                part3
        String[] part3 = new String[37];
        part3[24] = form_data.get("Program");
        part3[26] = form_data.get("node");
        part3[27] = form_data.get("Thermal_occupancy_effect");
        part3[28] = form_data.get("Truncation_radius");
        part3[29] = form_data.get("Kpoints");
        part3[30] = form_data.get("Calculated_level");
        part3[31] = form_data.get("Basis");
        for (int i = 0; i < part3.length; i++) {
            if (isEmpty(part3[i])) {
                part3[i] = "null";
            }
        }
        //                part4
        String[] part4 = new String[57];
        part4[3] = form_data.get("energy");
        part4[8] = form_data.get("atomic");
        part4[9] = form_data.get("x_coor");
        part4[10] = form_data.get("y_coor");
        part4[11] = form_data.get("z_coor");
        part4[15] = form_data.get("Fermi_energy_ha");
        part4[16] = form_data.get("Fermi_energy_ev");
        part4[17] = form_data.get("valence_band_edge_ha");
        part4[18] = form_data.get("valence_band_edge_ev");
        part4[19] = form_data.get("conduction_band_edge_ha");
        part4[20] = form_data.get("conduction_band_edge_ev");
        part4[22] = form_data.get("HOMO");
        part4[23] = form_data.get("LUMO");
        part4[25] = form_data.get("HOMO_LUMO");
        for (int i = 0; i < part4.length; i++) {
            if (isEmpty(part4[i])) {
                part4[i] = "null";
            }
        }

        Qm qm = new Qm();
        qm.setQM_USER_AND_PBC(StringUtils.join(part1, "wlcniubi"));
        qm.setQM_Calculation_object(StringUtils.join(part2, "wlcniubi"));
        qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(part3, "wlcniubi"));
        qm.setQM_Ground_state_excited_state(StringUtils.join(part4, "wlcniubi"));
        QmDao.data_save(qm, calculateObject);
    }

    /**
     * 处理Castep文件上传
     * @param author
     * @param cif_file_path
     * @param dosCastep_file_path
     * @param bandStrCastep_file_path
     * @param castep_file_path
     * @throws Exception
     */
    public static void processCastepFile(String author,
                                         String cif_file_path,
                                         String castep_file_path,
                                         String dosCastep_file_path,
                                         String bandStrCastep_file_path,
                                         String calculateObject) throws Exception {
        HashMap<String, String> form_data = QmDao.readAndProcess_CastepFile(cif_file_path, castep_file_path, dosCastep_file_path, bandStrCastep_file_path);

        //                part1
        String[] part1 = new String[8];
        part1[0] = LocalInformation.getTimeID();
        part1[1] = author;
        switch (calculateObject) {
            case "晶体":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = "null";
                part1[6] = "QM_CalculationObject_Crystal";
                break;
            case "Slab模型":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = "null";
                part1[6] = "QM_CalculationObject_Slab";
                break;
        }
        for (int i = 0; i < part1.length; i++) {
            if (isEmpty(part1[i])) {
                part1[i] = "null";
            }
        }
        //                part2
        String[] part2 = new String[1];
        switch (calculateObject) {
            case "晶体":
                part2 = new String[27];
                part2[2] = form_data.get("Crystal_Grid");
                HashMap<String, Integer> eleAndNum = wordCount(form_data.get("atomic").split(";"));
                Iterator iter = eleAndNum.entrySet().iterator();
                int i = 0;
                while (iter.hasNext()) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    part2[3 + i] = (String) entry.getKey();
                    part2[4 + i] = String.valueOf(entry.getValue());
                    i = i + 2;
                }
                part2[17] = form_data.get("Crystal_electronsNum");
                part2[18] = form_data.get("Crystal_upSpinsNum");
                part2[19] = form_data.get("Crystal_downSpinsNum");
                part2[20] = form_data.get("Crystal_bandsNum");
                break;
            case "Slab模型":
                part2 = new String[32];
                part2[2] = form_data.get("Crystal_Grid");
                eleAndNum = wordCount(form_data.get("atomic").split(";"));
                iter = eleAndNum.entrySet().iterator();
                i = 0;
                while (iter.hasNext()) {
                    Map.Entry entry = (Map.Entry) iter.next();
                    part2[6 + i] = (String) entry.getKey();
                    part2[7 + i] = String.valueOf(entry.getValue());
                    i = i + 2;
                }
                break;
        }
        for (int i = 0; i < part2.length; i++) {
            if (isEmpty(part2[i])) {
                part2[i] = "null";
            }
        }
        //                part3
        String[] part3 = new String[37];
        part3[24] = form_data.get("Program");
        part3[26] = form_data.get("node");
        part3[29] = form_data.get("Kpoints");
        part3[30] = form_data.get("Calculated_level");
        for (int i = 0; i < part3.length; i++) {
            if (isEmpty(part3[i])) {
                part3[i] = "null";
            }
        }
        //                part4
        String[] part4 = new String[57];
        part4[1] = form_data.get("Optimization_method");
        part4[4] = form_data.get("energy_ev");
        part4[8] = form_data.get("atomic");
        part4[9] = form_data.get("x_coor");
        part4[10] = form_data.get("y_coor");
        part4[11] = form_data.get("z_coor");
        part4[15] = form_data.get("Fermi_energy_ha");
        part4[36] = form_data.get("Bond_length");
        part4[41] = form_data.get("volume");
        part4[48] = form_data.get("Final_Free_Energy");
        for (int i = 0; i < part4.length; i++) {
            if (isEmpty(part4[i])) {
                part4[i] = "null";
            }
        }

        Qm qm = new Qm();
        qm.setQM_USER_AND_PBC(StringUtils.join(part1, "wlcniubi"));
        qm.setQM_Calculation_object(StringUtils.join(part2, "wlcniubi"));
        qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(part3, "wlcniubi"));
        qm.setQM_Ground_state_excited_state(StringUtils.join(part4, "wlcniubi"));
        QmDao.data_save(qm, calculateObject);
    }

    /**
     * 处理VASP文件上传
     * @param author
     * @param incar_file_path
     * @param poscar_file_path
     * @param potcar_file_path
     * @param cif_file_path
     * @param kpoints_file_path
     * @param contcar_file_path
     * @param outcar_file_path
     * @param calculateObject
     * @throws Exception
     */
    public static void processVaspFile(String author,
                                       String incar_file_path,
                                       String poscar_file_path,
                                       String potcar_file_path,
                                       String cif_file_path,
                                       String kpoints_file_path,
                                       String contcar_file_path,
                                       String outcar_file_path,
                                       String calculateObject) throws Exception {
        HashMap<String, String> form_data = QmDao.readAndProcess_VaspFile(incar_file_path, poscar_file_path, potcar_file_path, cif_file_path, kpoints_file_path, contcar_file_path, outcar_file_path);

        //                part1
        String[] part1 = new String[8];
        part1[0] = LocalInformation.getTimeID();
        part1[1] = author;
        switch (calculateObject) {
            case "晶体":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = form_data.get("Space_group");
                part1[6] = "QM_CalculationObject_Crystal";
                break;
            case "Slab模型":
                part1[2] = "YES";
                part1[3] = form_data.get("Lattice_parameters_length");
                part1[4] = form_data.get("Lattice_parameters_angle");
                part1[5] = form_data.get("Space_group");
                part1[6] = "QM_CalculationObject_Slab";
                break;
        }
        //                part2
        String[] part2 = new String[1];
        switch (calculateObject) {
            case "晶体":
                part2 = new String[27];
                part2[2] = form_data.get("Crystal_Grid");
                String[] priAtomic = form_data.get("priAtomic").split(";");
                String[] priAtomic_num = form_data.get("priAtomic_num").split(";");
                for (int i = 0; i < priAtomic.length; i++) {
                    part2[3 + i * 2] = priAtomic[i];
                    part2[4 + i * 2] = priAtomic_num[i];
                }
                break;
            case "Slab模型":
                part2 = new String[32];
                part2[2] = form_data.get("Crystal_Grid");
                priAtomic = form_data.get("priAtomic").split(";");
                priAtomic_num = form_data.get("priAtomic_num").split(";");
                for (int i = 0; i < priAtomic.length; i++) {
                    part2[6 + i * 2] = priAtomic[i];
                    part2[7 + i * 2] = priAtomic_num[i];
                }
                break;
        }
        for (int i = 0; i < part2.length; i++) {
            if (isEmpty(part2[i])) {
                part2[i] = "null";
            }
        }
        //                part3
        String[] part3 = new String[37];
        part3[24] = form_data.get("Program");
        part3[29] = form_data.get("Kpoints");
        part3[30] = form_data.get("Calculated_level");
        for (int i = 0; i < part3.length; i++) {
            if (isEmpty(part3[i])) {
                part3[i] = "null";
            }
        }
        //                part4
        String[] part4 = new String[57];
        part4[4] = form_data.get("energy_ev");
        part4[8] = form_data.get("atomic");
        part4[9] = form_data.get("x_coor");
        part4[10] = form_data.get("y_coor");
        part4[11] = form_data.get("z_coor");
        part4[16] = form_data.get("Fermi_energy_ev");
        part4[41] = form_data.get("volume");
        for (int i = 0; i < part4.length; i++) {
            if (isEmpty(part4[i])) {
                part4[i] = "null";
            }
        }

        Qm qm = new Qm();
        qm.setQM_USER_AND_PBC(StringUtils.join(part1, "wlcniubi"));
        qm.setQM_Calculation_object(StringUtils.join(part2, "wlcniubi"));
        qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(part3, "wlcniubi"));
        qm.setQM_Ground_state_excited_state(StringUtils.join(part4, "wlcniubi"));
        QmDao.data_save(qm, calculateObject);
    }

    /**
     * 将QM表单数据处理后存储到数据库
     *
     * @param part1
     * @param part2
     * @param part3
     * @param part4
     * @param file_names
     */
    public static void saveQmForm(String part1, String part2, String part3, String part4, String[] file_names, String calculateObject) {
        //操作
        Qm qm = new Qm();
        int[] time = LocalInformation.getNowDate(qm.getDate());
        //      part1
        qm.setQM_USER_AND_PBC(part1);
        String file_path = "/file_data/compute_part/QM/" + time[0] + "_" + time[1] + "_" + time[2] + "/" + qm.getQM_USER_AND_PBC().get(0) + "_";
        //      part2
        qm.setQM_Calculation_object(part2);
        //      part3
        String[] tempPart3 = part3.split("wlcniubi");
        tempPart3[16] = file_names[0].equals("null") ? "null" : file_path + file_names[0];
        tempPart3[23] = file_names[1].equals("null") ? "null" : file_path + file_names[1];
        qm.setQM_Electronic_Structure_Quantum_Mechanics_Calculation(StringUtils.join(tempPart3, "wlcniubi"));
        //      part4
        String[] tempPart4 = part4.split("wlcniubi");
        tempPart4[2] = file_names[2].equals("null") ? "null" : file_path + file_names[2];
        tempPart4[52] = file_names[3].equals("null") ? "null" : file_path + file_names[3];
        tempPart4[53] = file_names[4].equals("null") ? "null" : file_path + file_names[4];
        tempPart4[54] = file_names[5].equals("null") ? "null" : file_path + file_names[5];
        qm.setQM_Ground_state_excited_state(StringUtils.join(tempPart4, "wlcniubi"));
        //      存储到数据库
        QmDao.data_save(qm, calculateObject);
    }


}
